// cf-468-b
// 题意：
// 给定n(<=10^5)个数，然后给定两个数a, b，现在问是否可以将这n个数划分成
// 两个集合A, B，使得：
//   对于集合A满足任意数x属于A则a-x也属于A，
//   对于集合B满足任意数x属于B则b-x也属于B，
// 如果可以输出一种方案，否则输出NO
//
// 题解：
// TODO
//
// run: $exec < input
#include <iostream>
#include <map>

int const maxn = 101000;
int father[maxn];
int a[maxn];
int v[maxn];
int ans[maxn];
int n, sa, sb;
std::map<int, int> id;

int get_father(int x)
{
	return x == father[x] ? x : father[x] = get_father(father[x]);
}

void set_union(int x, int y)
{
	int tx = get_father(x);
	int ty = get_father(y);
	if (tx != ty) father[tx] = ty;
}

int main()
{
	std::ios::sync_with_stdio(false);
	std::cin >> n >> sa >> sb;
	for (int i = 1; i <= n; i++) {
		std::cin >> a[i];
		id[a[i]] = i;
		father[i] = i;
	}

	for (int i = 1; i <= n; i++) {
		if (id.count(sa - a[i])) { set_union(i, id[sa - a[i]]); v[i] |= 1; }
		if (id.count(sb - a[i])) { set_union(i, id[sb - a[i]]); v[i] |= 2; }
	}

	for (int i = 1; i <= n; i++) ans[i] = 3;
	for (int i = 1; i <= n; i++) ans[get_father(i)] &= v[i];

	for (int i = 1; i <= n; i++)
		if (!ans[i]) { std::cout << "NO\n"; return 0; }

	std::cout << "YES\n";
	for (int i = 1; i <= n; i++) {
		int tmp = ans[get_father(i)];
		std::cout << char('0' + !(tmp & 1));
		if (i != n) std::cout << " ";
	}
}

